package com.web.rabitmq.receiver.com.web.listener;


import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Direct监听消息队列发送消息监听器
 */
@Component
@RabbitListener(queues = "queue")//绑定队列名queue
public class DirectReciverListener {
    @RabbitHandler
    public void receive(String msg) {
        System.out.println("接收到消息队列的消息:"+msg);
    }
}